﻿using System.Linq;
using System.Runtime.Serialization;
using System.Collections.Generic;

namespace TheVerge.Base {
	[DataContract]
	public class GalleryEntry : Entry {


		private GalleryPhoto[] _Photos;

		[DataMember(Name = "photos")]
		public GalleryPhoto[] Photos {
			get { return _Photos; }
			set {
				if (value == null) _Photos = value;
				
				for (int i = 0; i < value.Length; i++) {
					value[i].Number = i + 1;
				}
				_Photos = value;
			}
		}

		[IgnoreDataMember]
		public string CoverPhoto { get { return API.GetGalleryPhotoUrl(Id, 640, 216); } }
	}
}
